Texture2D diffuseTexture : DIFFUSE <
	string name = "seafloor.dds"; 
	string UIName = "Diffuse Texture";
>;
	
SamplerState diffuseSampler
{
	Filter = MIN_MAG_MIP_LINEAR;
	AddressU = CLAMP;
	AddressV = CLAMP;
};

matrix g_World : World;
matrix g_WorldInv : WorldInverseTranspose;
matrix g_WVP : WorldViewProjection;
matrix g_ViewInv : ViewInverse;


struct VS_INPUT
{
    float3 Pos          : POSITION;         //position
    float2 Tex          : TEXCOORD0;        //texture coordinate
};

struct PS_INPUT
{
    float4 Pos : SV_POSITION;
    float4 WorldPos : TEXCOORD1;
    float2 Tex : TEXCOORD2;
};


//--------------------------------------------------------------------------------------
// Vertex Shader
//--------------------------------------------------------------------------------------
PS_INPUT VS( VS_INPUT input )
{
    PS_INPUT output = (PS_INPUT)0;
    float4 hPos = float4(input.Pos, 1);
    output.Pos = mul(hPos, g_WVP);
    output.WorldPos = mul(hPos, g_World);
    output.Tex = input.Tex;
    
    return output;
}


//--------------------------------------------------------------------------------------
// Pixel Shader
//--------------------------------------------------------------------------------------

float4 PS( PS_INPUT input) : SV_Target
{
	return float4(diffuseTexture.Sample(diffuseSampler, input.Tex).rgb, 1);
}


RasterizerState EnableCulling
{
    CullMode = Back;
    //FillMode = Wireframe;
    FrontCounterClockwise = false;
};

//--------------------------------------------------------------------------------------
// Technique
//--------------------------------------------------------------------------------------
technique10 Render
{
    pass P0
    {
        SetVertexShader( CompileShader( vs_4_0, VS() ) );
        SetGeometryShader( NULL );
        SetPixelShader( CompileShader( ps_4_0, PS() ) );
        
        SetRasterizerState(EnableCulling);
    }
}

